<template>
  <div style="overflow-y: hidden">
    <!--    <pre>{{route.meta }}</pre>-->
    <el-container>
      <el-aside :width="iscollapse?'64px':'160px'">
        <el-menu
            router
            :collapse="iscollapse"
            default-active="$route.path"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#bfdbc9">
          <el-menu-item v-for="item of $store.state.userMenu"
                        :key="item.path"
                        :index="item.path">
            <i :class="`el-icon-${item.meta.icon}`"></i>
            <span slot="title">{{ item.meta.title }}</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header class="box-header">
          <div class="headerr">
            <div class="icon" @click="change">
              <i v-show="!iscollapse" class="el-icon-s-fold"></i>
              <i v-show="iscollapse" class="el-icon-s-unfold"></i>
            </div>
          </div>
          <div class="daohangtiao">
            <headerrr></headerrr>
          </div>
        </el-header>
        <el-main>
          <div class="zy-main">
            <el-scrollbar>
              <transition name="my-transition">
                <router-view></router-view>
              </transition>
            </el-scrollbar>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import headerrr from "../header/headerr";
import {getMenu} from "../../api/user";

export default {
  name: "home",
  components: {
    headerrr,
  },
  data() {
    return {
      iscollapse: false,
    }
  },
  computed: {},
  created() {

  },
  methods: {

    change() {
      this.iscollapse = !this.iscollapse
      this.$bus.$emit('resize')
    }
  }
}
</script>

<style scoped>
.my-transition-enter {
  transform: translateX(-50px);
  opacity: 0;
}

.my-transition-enter-to {
  opacity: 1;
}

.my-transition-enter-active {
  transition: all .5s ease;
}

.headerr {
  /*float: left;*/
}

.daohangtiao {
  /*margin-left: 60px;*/
}

.box-header {
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
}

.headerr .icon {
  width: 50px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  /*padding-top:10px;*/
  font-size: 28px;
}

.el-header {
  background-color: #fff;
  color: #333;
  height: 60px !important;
  padding: 0;
  margin: 0 !important;
}

.el-menu {
  border-right: none;
  background-color: #545c64;

}

.el-aside {
  background-color: #545c64;
  height: 100vh;
  transition: all 0.3s ease-in-out;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 160px;
}

.zy-main {
  /*overflow: hidden;*/
  height: calc(100vh - 100px);
}

.el-scrollbar {
  height: 100%;
}

>>> .el-scrollbar__wrap {
  overflow-x: hidden;
}
.aa{

}
</style>